package com.ywt.cda.dao.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Repository;

import com.ywt.cda.core.dao.page.Page;
import com.ywt.cda.dao.SCategoryDao;
import com.ywt.cda.domain.SCategory;

@Repository("sCategoryDao")
public class SCategoryDaoImpl implements SCategoryDao {
	@Resource(name = "sqlSession")
	private SqlSession sqlSession;

	@Override
	public List<SCategory> list(Map<String, Object> params, Page page) {
		List<SCategory> list = null;
		if (null == page) {
			list=sqlSession.selectList("SCategory.list", params);
		}
		else {
			list = this.sqlSession.selectList("SCategory.list", params, page);
			page.setResult(list);
		}

		return list;
	}

}
